<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            width: 50px;
        }
    </style>
</head>
<body>
    <input type="text"><img src="./微信图片_20241101143923.png" alt="">
    <span>请输入6到10为的密码</span>
   
</body>

</html>
<script>
    var img=document.querySelector('img');
    var ipt=document.querySelector('input');
    var span=document.querySelector('span');

    ipt.onblur=function(){
        if(ipt.value.length<=10&&ipt.value.length>=6){
            span.innerHTML='输入正确'
            img.src='./微信截图_20241101143814.png'
        }else{
            span.innerHTML='输入错误'
            img.src='./微信图片_20241101143923.png';
        }
    }
</script>